home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_9.lha / 8_9 / 8_9a4.c < prev    next >
Text File  |  1993-08-08  |  421b  |  23 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. nt egetc(eFILE *efp, long offset)
  6.  
  7.    if (!efp || !efp->fp)
  8. return EOF;
  9.  
  10.    if (offset != efp->fileoffset)
  11. if (fseek(efp->fp, offset, 0))
  12.     return EOF;
  13.  
  14.    int c = getc(efp->fp);
  15.    if (c == EOF)
  16. efp->fileoffset = offset;
  17.  
  18.    else
  19. efp->fileoffset = offset + 1;
  20.  
  21.    return c;
  22.  
  23.